<?php
	session_start();
	$_SESSION['role']=1;
	function dated($var,$type){
		return date($type,$var);
	}
	function substrd($var,$num){
		return mb_substr($var,0,$num,"utf8");
	}
	define("PATH_HD",__FILE__);
	//$_SESSION['role']='admin';
	setcookie("cate","php");
	include "./smarty/Smarty.class.php";
	$smarty = new smarty();
	// $smarty->left_delimiter = "{hd"; //开始定界符
	// $smarty->right_delimiter = "/}"; //结束定界符
	$smarty->template_dir = "./template";//模板目录
	$smarty->compile_dir = "./compile";//编译目录
	$smarty->config_dir = "./config";//配置文件目录
	$smarty->cache_dir = "./cache";//缓存目录
	$smarty->assign("webname","baidu");
	$smarty->assign("arr",array("qq"=>"北京上海南京"));
	$arr=array(
		array(
		"title"=>'标题1',
		"con"=>"正文1"
		),
		array(
		"title"=>'标题2',
		"con"=>"正文2"
		),
		array(
		"title"=>'标题3',
		"con"=>"正文1"
		),
		array(
		"title"=>'标题4',
		"con"=>"正文2"
		)
	);
	$smarty->assign("arr2",$arr);
	$smarty->assign("title","<h1>title</h1>");
	$smarty->assign("time",time());
	$smarty->display("index.html");










?>